/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.hvtt.web.controller;

import com.hvtt.web.connection.Command;
import com.hvtt.web.connection.WEBConnection;
import com.hvtt.web.connection.WEBParamCollection;
import com.hvtt.web.models.RPT_ThongKeNapTienModel;
import com.hvtt.web.utilities.Utilities;
import java.io.File;
import java.io.IOException;
import java.io.Serializable;
import java.sql.SQLException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import org.primefaces.context.RequestContext;
import org.primefaces.model.DefaultTreeNode;
import org.primefaces.model.StreamedContent;
import org.primefaces.model.TreeNode;
import org.primefaces.model.chart.CartesianChartModel;
import org.primefaces.model.chart.LineChartSeries;
import org.primefaces.model.chart.PieChartModel;

/**
 *
 * @author Administrator
 */
@ManagedBean
@SessionScoped
public class RPT_ThongKeNapTienController  implements Serializable {
     private WEBConnection DAL = WEBConnection.getInstance();
      ReportEcxelController controller=new ReportEcxelController();
    private StreamedContent fileExporter;
       private String cpid = "";
    private String hdh = "";
    private String gameID = "";
    private String congTT = "";
    private String telco = "";
    private String loaiThongKe = "";
    private Date tuNgay = Calendar.getInstance().getTime();
    private Date denNgay = new java.sql.Date(0);
    private long giaTriTheNap = 0;
    private String page = "";
    private String loaiBD = "";
    
    private long tong1=0;
    private long tong2=0;
    private long tong3=0;
    private long tong4=0;
    
    public String getPage() {
        return page;
    }

    public void setPage(String page) {
        this.page = page;
    }

    /**
     * @return the cpid
     */
    public String getCpid() {
        return cpid;
    }

    /**
     * @param cpid the cpid to set
     */
    public void setCpid(String cpid) {
        this.cpid = cpid;
    }

    /**
     * @return the hdh
     */
    public String getHdh() {
        return hdh;
    }

    /**
     * @param hdh the hdh to set
     */
    public void setHdh(String hdh) {
        this.hdh = hdh;
    }

    /**
     * @return the gameID
     */
    public String getGameID() {
        return gameID;
    }

    /**
     * @param gameID the gameID to set
     */
    public void setGameID(String gameID) {
        this.gameID = gameID;
    }

    /**
     * @return the congTT
     */
    public String getCongTT() {
        return congTT;
    }

    /**
     * @param congTT the congTT to set
     */
    public void setCongTT(String congTT) {
        this.congTT = congTT;
    }

    /**
     * @return the telco
     */
    public String getTelco() {
        return telco;
    }

    /**
     * @param telco the telco to set
     */
    public void setTelco(String telco) {
        this.telco = telco;
    }

    /**
     * @return the loaiThongKe
     */
    public String getLoaiThongKe() {
        return loaiThongKe;
    }

    /**
     * @param loaiThongKe the loaiThongKe to set
     */
    public void setLoaiThongKe(String loaiThongKe) {
        this.loaiThongKe = loaiThongKe;
    }

    /**
     * @return the tuNgay
     */
    public Date getTuNgay() {
        return tuNgay;
    }

    /**
     * @param tuNgay the tuNgay to set
     */
    public void setTuNgay(Date tuNgay) {
        this.tuNgay = tuNgay;
    }

    /**
     * @return the denNgay
     */
    public Date getDenNgay() {
        return denNgay;
    }

    /**
     * @param denNgay the denNgay to set
     */
    public void setDenNgay(Date denNgay) {
        this.denNgay = denNgay;
    }

    /**
     * @return the giaTriTheNap
     */
    public long getGiaTriTheNap() {
        return giaTriTheNap;
    }

    /**
     * @param giaTriTheNap the giaTriTheNap to set
     */
    public void setGiaTriTheNap(long giaTriTheNap) {
        this.giaTriTheNap = giaTriTheNap;
    }

    /**
     * @return the loaiBD
     */
    public String getLoaiBD() {
        return loaiBD;
    }

    /**
     * @param loaiBD the loaiBD to set
     */
    public void setLoaiBD(String loaiBD) {
        this.loaiBD = loaiBD;
    }

    /**
     * @return the tong1
     */
    public long getTong1() {
        return tong1;
    }

    /**
     * @param tong1 the tong1 to set
     */
    public void setTong1(long tong1) {
        this.tong1 = tong1;
    }

    /**
     * @return the tong2
     */
    public long getTong2() {
        return tong2;
    }

    /**
     * @param tong2 the tong2 to set
     */
    public void setTong2(long tong2) {
        this.tong2 = tong2;
    }

    /**
     * @return the tong3
     */
    public long getTong3() {
        return tong3;
    }

    /**
     * @param tong3 the tong3 to set
     */
    public void setTong3(long tong3) {
        this.tong3 = tong3;
    }

    /**
     * @return the tong4
     */
    public long getTong4() {
        return tong4;
    }

    /**
     * @param tong4 the tong4 to set
     */
    public void setTong4(long tong4) {
        this.tong4 = tong4;
    }
    
    
    
    
    public List<RPT_ThongKeNapTienModel> RPT_ThongKeNapTien() throws SQLException {

        WEBParamCollection Params = new WEBParamCollection();
        Params.add(this.getCpid());
        Params.add(this.getGameID());
        Params.add(this.getHdh());
        Params.add(getTuNgay());
        Params.add(getDenNgay());
        List<RPT_ThongKeNapTienModel> lst = DAL.executeQuery("{call RPT_ThongKeNapTien(?,?,?,?,?)}", Command.sqlStoredProcedure, Params, RPT_ThongKeNapTienModel.class);
        return lst == null ? new ArrayList() : lst;
    }

    public TreeNode RPT_ThongKeNapTien_ThongKe() throws SQLException {
        TreeNode root = new DefaultTreeNode(new RPT_ThongKeNapTienModel(), null);
        WEBParamCollection Params = new WEBParamCollection();
        Params.add(("-1".equals(this.getCpid()) ? "" : this.getCpid()));
        Params.add(("-1".equals(this.getGameID()) ? "" : this.getGameID()));
        Params.add(("-1".equals(this.getHdh()) ? "" : this.getHdh()));
        Params.add(this.getTuNgay());
        Params.add(this.getDenNgay());
        List<RPT_ThongKeNapTienModel> lst = DAL.executeQuery("{call RPT_ThongKeNapTien(?,?,?,?,?)}", Command.sqlStoredProcedure, Params, RPT_ThongKeNapTienModel.class);
        int i = 0;
        String strCPID;
        long lTong1=0;
        long lTong2=0;
        
        
        while (i < lst.size()) {
            strCPID = lst.get(i).getCpid();
            RPT_ThongKeNapTienModel m = new RPT_ThongKeNapTienModel();
            m.setCpName(lst.get(i).getCpName());
            TreeNode noteParent = new DefaultTreeNode(m, root);
            noteParent.setExpanded(true);
            int iCountUser=0;
            
            
            int iCount=0;
          

            int iSoTien = 0;
           
            if (i < lst.size()) {
                 while (i < lst.size() && (lst.get(i).getCpid() == null ? strCPID == null : lst.get(i).getCpid().equals(strCPID))) {
                       String strHDH = lst.get(i).getHdh();
                        RPT_ThongKeNapTienModel m_Teleco = new RPT_ThongKeNapTienModel();
                        //m_Teleco.setCongTT("");
                        m_Teleco.setCpName(lst.get(i).getHdh());
                       // m_Teleco.setTelco("");

                        TreeNode noteParent_Teleco = new DefaultTreeNode(m_Teleco, noteParent);
                        noteParent_Teleco.setExpanded(true);
                        
                        int iTongHDH=0;
                        int iSoTienHDH=0;
                     while (i < lst.size() && (lst.get(i).getHdh()== null ? strHDH== null : lst.get(i).getHdh().equals(strHDH))) {
                           
                            //lst.get(i).setHdh("");
                            RPT_ThongKeNapTienModel m1=lst.get(i);
                            m1.setCpName("");
                            if(m1.getUserName().length()>=4)
                            {
                                m1.setUserName(m1.getUserName().substring(0, 4)+"****");
                            }
                            
                            
                            iTongHDH ++;
                            
                            lTong1++;
                            iSoTien+=m1.getSoTien();
                            iSoTienHDH+=m1.getSoTien();
                            lTong2+=m1.getSoTien();
                            
                             iCountUser++;
                            noteParent_Teleco.getChildren().add(new DefaultTreeNode(m1));
                            
                            i++;
                     }
                     //nodeHDH.setExpanded(true);
                     m_Teleco.setSoTK(iTongHDH);
                     m_Teleco.setSoTien(iSoTienHDH);
                     m_Teleco.setUserName(String.valueOf(iTongHDH));
                    // m_Teleco.setCpName(m_Teleco.getHdh());
                    // noteParent.getChildren().add(nodeHDH);
                     iCount+=iTongHDH;                   
                }
//                while (i < lst.size() && (lst.get(i).getCpid() == null ? strCPID == null : lst.get(i).getCpid().equals(strCPID))) {
//                    lst.get(i).setCpName("");
//                    
//                    if(lst.get(i).getUserName().length()>=4)
//                    {
//                       
//                        lst.get(i).setUserName(lst.get(i).getUserName().substring(0,4)+ "****");
//                    }
//                    
//                    noteParent.getChildren().add(new DefaultTreeNode(lst.get(i)));
//                    iSoTien += lst.get(i).getSoTien();
//                    lTong1+=lst.get(i).getSoTien();
//                    if(HDH == null ? lst.get(iHDH).getHdh() != null : !HDH.equals(lst.get(iHDH).getHdh()))
//                        iHDH++;
//                    
//                    i++;
//                    iCountUser++;
//                    
//                }
//                m.setGame("");
//
//                m.setSoTien(iSoTien);
//                m.setSoTK(i);
//                m.setHdh(String.valueOf(iHDH));
            }
            //  i++;
           m.setUserName(String.valueOf(iCountUser));
           m.setSoTien(iSoTien);
            noteParent.setExpanded(true);
        }
        this.setTong1(lTong1);
        this.setTong2(lTong2);
        this.setTong3(0);
        return root;
    }

    public PieChartModel RPT_ThongKeNapTien_Chart() throws SQLException {
        PieChartModel c = new PieChartModel();
        List<RPT_ThongKeNapTienModel> lst;

      
        WEBParamCollection Params = new WEBParamCollection();

        Params.add(("-1".equals(this.getCpid()) ? "" : this.getCpid()));
        Params.add(("-1".equals(this.getGameID()) ? "" : this.getGameID()));
        Params.add(("-1".equals(this.getHdh()) ? "" : this.getHdh()));
        Params.add(this.getTuNgay());
        Params.add(this.getDenNgay());
        lst = DAL.executeQuery("{call RPT_ThongKeNapTien_Chart(?,?,?,?,?)}", Command.sqlStoredProcedure, Params, RPT_ThongKeNapTienModel.class);


        for (RPT_ThongKeNapTienModel m : lst) {
           c.set(m.getHdh() + " " + String.valueOf(m.getSoTK()), m.getSoTK());
        }


      
        return c;
    }
    public PieChartModel RPT_ThongKeNapTien_Chart_TyLeUserNapTienTheoCP() throws SQLException {
        PieChartModel c = new PieChartModel();
        List<RPT_ThongKeNapTienModel> lst;

      
        WEBParamCollection Params = new WEBParamCollection();

        Params.add(("-1".equals(this.getCpid()) ? "" : this.getCpid()));
        Params.add(("-1".equals(this.getGameID()) ? "" : this.getGameID()));
        Params.add(("-1".equals(this.getHdh()) ? "" : this.getHdh()));
        Params.add(this.getTuNgay());
        Params.add(this.getDenNgay());
        lst = DAL.executeQuery("{call RPT_ThongKeNapTien_Chart_TyLeUserTheoCP(?,?,?,?,?)}", Command.sqlStoredProcedure, Params, RPT_ThongKeNapTienModel.class);


        for (RPT_ThongKeNapTienModel m : lst) {
           c.set(m.getCpName()+ " " + String.valueOf(m.getSoTK()), m.getSoTK());
        }


      
        return c;
    }
    public PieChartModel RPT_ThongKeNapTien_Chart_TyLeUserNapTienTheoCP0() throws SQLException {
        PieChartModel c = new PieChartModel();
        List<RPT_ThongKeNapTienModel> lst;

      
        WEBParamCollection Params = new WEBParamCollection();

        Params.add(("-1".equals(this.getCpid()) ? "" : this.getCpid()));
        Params.add(("-1".equals(this.getGameID()) ? "" : this.getGameID()));
        Params.add(("-1".equals(this.getHdh()) ? "" : this.getHdh()));
        Params.add(this.getTuNgay());
        Params.add(this.getDenNgay());
        lst = DAL.executeQuery("{call RPT_ThongKeNapTien_Chart_TyLeUserTheoHeDieuHanhCuaCP_0(?,?,?,?,?)}", Command.sqlStoredProcedure, Params, RPT_ThongKeNapTienModel.class);


        for (RPT_ThongKeNapTienModel m : lst) {
           c.set(m.getHdh()+ " " + String.valueOf(m.getSoTK()), m.getSoTK());
        }


      
        return c;
    }
    
    public CartesianChartModel RPT_ThongKeNapTien_Chart_line_ngay() throws SQLException {
        CartesianChartModel c = new CartesianChartModel();
        List<RPT_ThongKeNapTienModel> lst;

      
        WEBParamCollection Params = new WEBParamCollection();

        Params.add(("-1".equals(this.getCpid()) ? "" : this.getCpid()));
        Params.add(("-1".equals(this.getGameID()) ? "" : this.getGameID()));
        Params.add(("-1".equals(this.getHdh()) ? "" : this.getHdh()));
        Params.add(this.getTuNgay());
        Params.add(this.getDenNgay());
        lst = DAL.executeQuery("{call RPT_ThongKeNapTien_Chart_line_ngay(?,?,?,?,?)}", Command.sqlStoredProcedure, Params, RPT_ThongKeNapTienModel.class);
        
        if(Sys_NguoiDungController.findUser().isIsAdmin())
        {
            List<RPT_ThongKeNapTienModel> lst1=DAL.executeQuery("Select distinct CPID,CPName from users_report where users_report.CPID<>''",RPT_ThongKeNapTienModel.class);
            for(RPT_ThongKeNapTienModel m:lst1)
            {
                LineChartSeries l=new LineChartSeries();
                l.setLabel("Số user theo " + m.getCpName());
                int i=0;
                boolean bln=false;
                while(i<lst.size())
                {
                    if(!l.getData().containsKey(Utilities.parseDateTime(lst.get(i).getThoiGian(), "dd/MM")))
                    {
                        l.set(Utilities.parseDateTime(lst.get(i).getThoiGian(), "dd/MM"), 0);
                        l.setShowLine(true);
                    }
                    if(lst.get(i).getCpid() == null ? m.getCpid() == null : lst.get(i).getCpid().equals(m.getCpid()))
                    {
                         l.set(Utilities.parseDateTime(lst.get(i).getThoiGian(), "dd/MM"), lst.get(i).getSoTK());
                         l.setShowLine(true);
                         bln=true;
                    }
                    i++;
                }
                  if(bln)
                    c.addSeries(l);
            }
            
            LineChartSeries l1=new LineChartSeries();
            l1.setLabel("Tổng số user");
            int i=0;
            while(i<lst.size())
            {
                  l1.set(Utilities.parseDateTime(lst.get(i).getThoiGian(), "dd/MM"), lst.get(i).getTongCong());
                 l1.setShowLine(true);
                     i++;
            }
            
            
             c.addSeries(l1);
//            LineChartSeries l=new LineChartSeries();
//            LineChartSeries l1=new LineChartSeries();
//
//            l.setLabel("Số user nạp tiền theo CP");
//            l1.setLabel("Tổng số user nạp tiền");
//          for (RPT_ThongKeNapTienModel m : lst) {
//
//              l.setShowLine(true);
//              l.set(m.getThoiGian(), m.getSoTK());
//
//              l1.setShowLine(true);
//              l1.set(m.getThoiGian(), m.getTongCong());
//
//          }
//          c.addSeries(l);
//          c.addSeries(l1);

        }
        else
        {
            LineChartSeries l=new LineChartSeries();
            //LineChartSeries l1=new LineChartSeries();

            l.setLabel("Số user nạp tiền theo CP");
            //l1.setLabel("Tổng số user nạp tiền");
          for (RPT_ThongKeNapTienModel m : lst) {

              l.setShowLine(true);
              l.set(Utilities.parseDateTime(m.getThoiGian(), "dd/MM"), m.getSoTK());

//              l1.setShowLine(true);
//              l1.set(m.getThoiGian(), m.getTongCong());

          }
          c.addSeries(l);
         // c.addSeries(l1);

        }
        
      
        return c;
    }
    public CartesianChartModel RPT_ThongKeNapTien_Chart_line_thang() throws SQLException {
        CartesianChartModel c = new CartesianChartModel();
        List<RPT_ThongKeNapTienModel> lst;
       
      
        WEBParamCollection Params = new WEBParamCollection();

        Params.add(("-1".equals(this.getCpid()) ? "" : this.getCpid()));
        Params.add(("-1".equals(this.getGameID()) ? "" : this.getGameID()));
        Params.add(("-1".equals(this.getHdh()) ? "" : this.getHdh()));
        Params.add(this.getTuNgay());
        Params.add(this.getDenNgay());
        lst = DAL.executeQuery("{call RPT_ThongKeNapTien_Chart_line_thang(?,?,?,?,?)}", Command.sqlStoredProcedure, Params, RPT_ThongKeNapTienModel.class);

        if(Sys_NguoiDungController.findUser().isIsAdmin())
        {
             List<RPT_ThongKeNapTienModel> lst1=DAL.executeQuery("Select distinct CPID,CPName from users_report where users_report.CPID<>''",RPT_ThongKeNapTienModel.class);
            for(RPT_ThongKeNapTienModel m:lst1)
            {
                LineChartSeries l=new LineChartSeries();
                l.setLabel("Số user theo " + m.getCpName());
                int i=0;
                boolean bln=false;
                while(i<lst.size())
                {
                    if(!l.getData().containsKey(lst.get(i).getThang()))
                    {
                        l.set(lst.get(i).getThang(), 0);
                        l.setShowLine(true);
                    }
                    if(lst.get(i).getCpid() == null ? m.getCpid() == null : lst.get(i).getCpid().equals(m.getCpid()))
                    {
                         l.set(lst.get(i).getThang(), lst.get(i).getSoTK());
                         l.setShowLine(true);
                         bln=true;
                    }
                    i++;
                }
                 if(bln)
                    c.addSeries(l);
                
            }
            
            LineChartSeries l1=new LineChartSeries();
            l1.setLabel("Tổng số user");
            int i=0;
            while(i<lst.size())
            {

                  l1.set(lst.get(i).getThang(), lst.get(i).getTongCong());
                 l1.setShowLine(true);
                     i++;
             
                  
            }
            
//            LineChartSeries l=new LineChartSeries();
//            LineChartSeries l1=new LineChartSeries();
//
//             l.setLabel("Số user nạp tiền theo CP");
//            l1.setLabel("Tổng số user nạp tiền");
//          for (RPT_ThongKeNapTienModel m : lst) {
//             l.set(m.getThang(), m.getSoTK());
//             l.setShowLine(true);
//
//              l1.set(m.getThang(), m.getTongCong());
//             l1.setShowLine(true);

            // l.setFill(true);
             //l.setLabel(String.valueOf(m.getSoTien()));



//          }
//          c.addSeries(l);
//          c.addSeries(l1);

        }
        else
        {
            LineChartSeries l=new LineChartSeries();
            //LineChartSeries l1=new LineChartSeries();

             l.setLabel("Số user nạp tiền theo CP");
           // l1.setLabel("Tổng số user nạp tiền");
          for (RPT_ThongKeNapTienModel m : lst) {
             l.set(m.getThang(), m.getSoTK());
             l.setShowLine(true);

//              l1.set(m.getThang(), m.getTongCong());
//             l1.setShowLine(true);

            // l.setFill(true);
             //l.setLabel(String.valueOf(m.getSoTien()));



          }
          c.addSeries(l);
          //c.addSeries(l1);

        }
         
      
        return c;
    }
    public void cmd_RPT_ThongKeNapTien_Excel_Click(ActionEvent event) throws SQLException, ParseException {

        Map mapParams = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
        this.setCpid(String.valueOf(mapParams.get("CPID")));
        this.setGameID(String.valueOf(mapParams.get("Game")));
        this.setHdh(String.valueOf(mapParams.get("HDH")));
        String strTuNgay = String.valueOf(mapParams.get("TuNgay"));
        String strDenNgay = String.valueOf(mapParams.get("DenNgay"));
        setTuNgay(Utilities.parseDate(strTuNgay, "dd/MM/yyyy"));
        setDenNgay(Utilities.parseDate(strDenNgay, "dd/MM/yyyy"));

        WEBParamCollection Params = new WEBParamCollection();
        Params.add(("-1".equalsIgnoreCase(this.getCpid()) ? "" : this.getCpid()));
        Params.add(("-1".equalsIgnoreCase(this.getGameID()) ? "" : this.getGameID()));
        Params.add(("-1".equalsIgnoreCase(this.getHdh()) ? "" : this.getHdh()));
        Params.add(this.getTuNgay());
        Params.add(this.getDenNgay());
        List<RPT_ThongKeNapTienModel> lst = DAL.executeQuery("{call RPT_ThongKeNapTien(?,?,?,?,?)}", Command.sqlStoredProcedure, Params, RPT_ThongKeNapTienModel.class);

        setFileExporter(controller.thongKeNapTienToExcel(tuNgay, denNgay, lst));
        if (getFileExporter() != null) {
            try {
                Utilities.deleteFile(new File(controller.getLocalPath() + "/" + getFileExporter().getName()));
            } catch (IOException ex) {
                Logger.getLogger(ReportController.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }

    public void cmd_RPT_ThongKeNapTien_ThongKe_Click(ActionEvent event) throws SQLException, ParseException {
        Map mapParams = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
        this.setCpid(String.valueOf(mapParams.get("CPID")));
        this.setGameID(String.valueOf(mapParams.get("Game")));
        this.setHdh(String.valueOf(mapParams.get("HDH")));
        String strTuNgay = String.valueOf(mapParams.get("TuNgay"));
        String strDenNgay = String.valueOf(mapParams.get("DenNgay"));
        setTuNgay(Utilities.parseDate(strTuNgay, "dd/MM/yyyy"));
        setDenNgay(Utilities.parseDate(strDenNgay, "dd/MM/yyyy"));

        this.setPage("/layout/Web/thongkenaptien.xhtml");
        RequestContext.getCurrentInstance().execute("update=\":frmCommand\"");

    }

    public void cmd_RPT_ThongKeNapTien_Chart_Click(ActionEvent event) throws SQLException, ParseException {
        Map mapParams = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
        this.setCpid(String.valueOf(mapParams.get("CPID")));
        this.setGameID(String.valueOf(mapParams.get("Game")));
        this.setHdh(String.valueOf(mapParams.get("HDH")));
        String strTuNgay = String.valueOf(mapParams.get("TuNgay"));
        String strDenNgay = String.valueOf(mapParams.get("DenNgay"));
        setTuNgay(Utilities.parseDate(strTuNgay, "dd/MM/yyyy"));
        setDenNgay(Utilities.parseDate(strDenNgay, "dd/MM/yyyy"));
        
        this.setLoaiBD(String.valueOf(mapParams.get("Loai")));
        switch (this.getLoaiBD()) {
            case "2":
                this.setPage("/layout/Chart/thongkenaptien.xhtml");
                break;
            case "4":
                this.setPage("/layout/Chart/thongkenaptien_line_ngay.xhtml");
                break;
            case "5":
                this.setPage("/layout/Chart/thongkenaptien_line_thang.xhtml");
                break;
        }

        //this.setPage("/layout/Chart/thongkenaptien.xhtml");
        RequestContext.getCurrentInstance().execute("update=\":frmCommand\"");
    }

    /**
     * @return the fileExporter
     */
    public StreamedContent getFileExporter() {
        return fileExporter;
    }

    /**
     * @param fileExporter the fileExporter to set
     */
    public void setFileExporter(StreamedContent fileExporter) {
        this.fileExporter = fileExporter;
    }

    
}
